package com.iclient.web;

import org.springframework.ui.ModelMap;

public class BaseController {
	
	private static final String EMP_MSG = "";
	
	protected ModelMap buildResponseMap(Boolean success, Object object){
		ModelMap modelMap = new ModelMap();
		modelMap.addAttribute("success", success);
		modelMap.addAttribute("msg", EMP_MSG);
		modelMap.addAttribute("data", object);
		return modelMap;
	}
	
	protected ModelMap buildResponseMap(Boolean success, String msg, Object object){
		ModelMap modelMap = new ModelMap();
		modelMap.addAttribute("success", success);
		modelMap.addAttribute("msg", msg);
		modelMap.addAttribute("data", object);
		return modelMap;
	}

	protected ModelMap buildResponseMap(Boolean success, String msg){
		ModelMap modelMap = new ModelMap();
		modelMap.addAttribute("success", success);
		modelMap.addAttribute("msg", EMP_MSG);
		return modelMap;
	}
}
